const mongoose = require("./db")


const sxmenuschema = new mongoose.Schema({
    imags: String,
    title: String,
    times: Date,
    nums: Number,
    flag: {
        default: false,
        type: Boolean
    }
})
const bbSchema = mongoose.Schema({
    name: String,
})

const sxmenumodel = mongoose.model('sxmenu', sxmenuschema, 'sxmenu')


// 左盖豪分类
const zgh_cate_Schema = new mongoose.Schema({
    title: String,
    price: Number,
    img: String,
    cate: String,
    ren: Number
})

const zgh_cate_Model = mongoose.model('zgh_cate', zgh_cate_Schema, 'zgh_cate')



// 支付页 --- 于瑞涛
const yrtZhitou = mongoose.Schema({
    title: String
})
const yrtZhibody = mongoose.Schema({
    bian: String,
    title: String,
    flag: Number,
    imgs: Object,
    num: Number,
    price: Number,
    tid: {
        type: mongoose.Types.ObjectId,
        ref: "yrtzhifu"
    }
})
const yrttui = mongoose.Schema({
    xuan: String,
    yuan: String,
    img: String
})

// 登录
const loginSchema = new mongoose.Schema({
    username: String,
    phone: String,
    code: Number,     //验证码
    codeCreateAt: Date //验证码创建时间
})

const bbModel = mongoose.model('bb', bbSchema, 'bb')

const Yrtzhifu = mongoose.model('yrtzhifu', yrtZhitou, "yrtzhifu")
const Yrtzhibdy = mongoose.model('yrtzhibdy', yrtZhibody, 'yrtzhibdy')
const Yrttuikuan = mongoose.model('yrttui', yrttui, "yrttui")
let loginModel = mongoose.model('login', loginSchema, 'login')


// loginModel.create([
//     {
//         username:'lhs',
//         phone:'18830216851',
//         code:123456
//     }

// ])




// Yrtzhibdy.create({
//     bian: "FF20237711",
//     title: "待发货",
//     flag: 1,
//     imgs: [
//         {
//             img: "https://www.axured.cn/assets/axurefiles/dd9eb05e6076c704b2c1e0053def3cc6/images/%E9%A6%96%E9%A1%B5/u167.png",
//             name: "河北梨 约3斤",
//             num: 1,
//             price:"20"
//         },
//         {
//             img: "https://www.axured.cn/assets/axurefiles/dd9eb05e6076c704b2c1e0053def3cc6/images/%E9%A6%96%E9%A1%B5/u215.png",
//             name: "大号翡翠青白虾仁1000g",
//             num: 5,
//             price:"25"
//         },
//         {
//             img: "https://www.axured.cn/assets/axurefiles/dd9eb05e6076c704b2c1e0053def3cc6/images/%E9%A6%96%E9%A1%B5/u228.png",
//             name: "菠菜赤根菜 约400g",
//             num: 10,
//             price:"5"
//         },
//         {
//             img: "https://www.axured.cn/assets/axurefiles/dd9eb05e6076c704b2c1e0053def3cc6/images/%E9%A6%96%E9%A1%B5/u255.png",
//             name: "猪肋骨三斤装（无脊骨）",
//             num: 1,
//             price:"120"
//         },
//     ],
//     num: 1,
//     price: 9,
//     tid: "65292687cc339d86b7c7fb53"
// })

module.exports = {
    bbModel,
    Yrtzhifu,
    Yrtzhibdy,
    zgh_cate_Model,
    sxmenumodel,
    Yrttuikuan
}
